/**
 * 文章评论列表
 */

import request from '@/utils/request'

export const getCommments = params =>{
    return request({
        url:'/app/v1_0/comments',
        method:'GET',
        params
    })
}

/**
 * 对文章点赞或评论
 */
export const addCommentLike = target=>{
    return request({
        url:'/app/v1_0/comment/likings',
        method:"POST",
        data:{
            target
        }
    })
}


/**
 * 取消对文章点赞或评论
 */
export const deleteCommentLike = target => {
    return request({
        url: `/app/v1_0/article/collections/${target}`,
        method: "DELETE"
    })
}



/**
 * 添加评论
 */

export const addComment = data => {
    return request({
        url:"/app/v1_0/comments",
        method: "POST",
        data
    })
}